package com.xyy.ebattery.tcp.app;

import com.xyy.ebattery.tcp.app.config.NettyConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


/**
 * @Description TODO
 * @author JIA BOYAN
 * date 2025/06/16  17.41
 */
@Component
@Order(1)
public class NettyServerRunner implements CommandLineRunner {

    @Autowired
    private NettyServer nettyServer;

    @Autowired
    private NettyConfig nettyConfig;

    @Override
    public void run(String... args) throws Exception {
        nettyServer.start(nettyConfig.getPort());
    }
}